<?php
session_start();
require_once 'config.php';
if (!file_exists('install.lock')) {
    header('Location: install.php');
    exit;
}


// 自动获取协议和域名
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https://' : 'http://';
$host = $_SERVER['HTTP_HOST'];
define('VALIDATION_API', $protocol . $host . '/api/check_kami.php');
define('API_KEY', '123');

function MkEncrypt($pageId = 'default') {
    $pageId = md5($pageId);
    $cookieName = 'mk_encrypt_'.$pageId;
    javascript:;
    // Cookie验证
    if (isset($_COOKIE[$cookieName])) {
        $result = verifykami($_COOKIE[$cookieName]);
        if ($result['status']) return;
    }

    // 表单验证
    if (isset($_POST['kami'])) {
        $result = verifykami($_POST['kami']);
        if ($result['status']) {
            setcookie($cookieName, $_POST['kami'], time() + 86400 * 30, '/');
            header("Refresh:0");
            exit;
        }
        $error = $result['msg'];
    }

    $settings = getSettings();
    showAuthForm($error ?? '', $settings);
}

function verifykami($kami) {
    $data = [
        'api_key' => API_KEY,
        'kami' => $kami
    ];

    $ch = curl_init();
    curl_setopt_array($ch, [
        CURLOPT_URL => VALIDATION_API,
        CURLOPT_POST => true,
        CURLOPT_POSTFIELDS => json_encode($data),
        CURLOPT_RETURNTRANSFER => true,
        CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
        CURLOPT_TIMEOUT => 10,
        CURLOPT_SSL_VERIFYPEER => true
    ]);
    
    $response = curl_exec($ch);
    $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    curl_close($ch);

    if ($httpCode !== 200) {
        return ['status' => 0, 'msg' => '无法连接验证服务器'];
    }
    
    return json_decode($response, true) ?? ['status' => 0, 'msg' => '无效响应'];
}






function showAuthForm($error, $settings) {
    // 获取系统设置

    ?>

<!doctype html>

<html lang="zh-CN"> 
 <head> 
  <meta charset="UTF-8"> 
  <meta content="always" name="referrer">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
  <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=0, minimum-scale=1.0, maximum-scale=0.0, viewport-fit=cover"> 
  <meta name="applicable-device" content="pc,mobile"> 
  <meta http-equiv="Cache-Control" content="no-transform"> 
  <meta http-equiv="Cache-Control" content="no-siteapp"> 
  <meta name="robots" content="max-image-preview:large"> 
  <meta name="keywords" content=""> 
  <meta name="description" content=""> 
  <meta name="author" content=""> 
  <meta name="copyright" content=""> 
  <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"> 
  <meta name="viewport" content="width=device-width"> 
  	<link href="https://lib.baomitu.com/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
  <script src="https://lib.baomitu.com/jquery/1.12.4/jquery.min.js"></script>
  <script src="https://lib.baomitu.com/layer/3.5.1/layer.js"></script>
  <link rel="stylesheet" href="https://lib.baomitu.com/layer/3.1.1/theme/default/layer.css?v=3.1.1"
 </head>
  <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
            background-image: linear-gradient(180deg, #2af598 0%, #009efd 100%);
            background-size: 200% 200%;
            animation: gradientBG 15s ease infinite;
            min-height: 100vh;
            color: #333;
        }

        #main {
            max-width: 1000px;
            margin: 0 auto;
            padding: 20px;
        }

        .brand {
            text-align: center;
            padding: 40px 0;
            color: #fff;
            animation: fadeInDown 1s ease;
        }

        .brand-title {
            font-size: 3.5em;
            font-weight: 600;
            margin-bottom: 15px;
            text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
            background: linear-gradient(180deg, #2af598 0%, #009efd 100%);;
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .brand-flag {
            background: rgba(255,255,255,0.15);
            color: #009efd;
            padding: 8px 25px;
            border-radius: 30px;
            font-size: 1.1em;
            font-weight: 500;
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255,255,255,0.2);
        }

        .card {
            background: rgba(255, 255, 255, 0.9);
            border-radius: 24px;
            padding: 30px;
            margin-bottom: 25px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.1);
            backdrop-filter: blur(10px);
            transition: all 0.3s ease;
            animation: fadeInUp 0.8s ease;
            animation-fill-mode: both;
            border: 1px solid rgba(255,255,255,0.2);
        }

        .card:hover {
            transform: translateY(-5px);
            box-shadow: 0 15px 40px rgba(99, 102, 241, 0.15);
        }

        .button-group {
            display: grid;
            grid-template-columns: repeat(4, 1fr);
            gap: 15px;
            padding: 20px;
            max-width: 100%;
        }

        .enter-button {
            background: linear-gradient(45deg, #2af598, #009efd);
            color: white;
            padding: 16px 20px;
            border-radius: 30px;
            text-decoration: none;
            display: flex;
            justify-content: center;
            align-items: center;
            font-weight: 500;
            font-size: 1.1em;
            transition: all 0.3s ease;
            box-shadow: 0 5px 15px rgba(116, 235, 213, 0.4);
            width: 100%;
            text-align: center;
        }

        .enter-button:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(159, 172, 230, 0.5);
            background: linear-gradient(45deg, #009efd, #2af598);
        }

        .title {
            color: #009efd;
            font-size: 1.4em;
            margin-bottom: 20px;
            display: flex;
            align-items: center;
            gap: 12px;
            font-weight: 600;
        }

        .title::before {
            content: "";
            width: 4px;
            height: 25px;
            background: linear-gradient(to bottom, #2af598, #009efd);
            display: inline-block;
            border-radius: 4px;
        }

        .link-list {
            list-style: none;
        }

        .link-list li {
            margin: 12px 0;
            line-height: 1.8;
            transition: all 0.3s ease;
            padding: 12px 20px;
            border-radius: 12px;
            background: rgba(255,255,255,0.5);
        }

        .link-list li:hover {
            background: rgba(102,126,234,0.1);
            transform: translateX(5px);
        }

        .link-list a {
            color: #009efd;
            text-decoration: none;
            transition: all 0.3s ease;
            font-weight: 500;
        }

        .link-list a:hover {
            color: #2af598;
        }

        .tip-item {
            background: rgba(255,255,255,0.5);
            padding: 20px;
            border-radius: 16px;
            margin: 15px 0;
            border: 1px solid rgba(255,255,255,0.2);
        }

        .browser-tip {
            display: flex;
            align-items: center;
            gap: 12px;
            margin: 12px 0;
            padding: 8px 0;
            color: #666;
        }

        .icon {
            width: 24px;
            height: 24px;
            background-size: contain;
        }

        @keyframes fadeInDown {
            from {
                opacity: 0;
                transform: translateY(-20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes fadeInUp {
            from {
                opacity: 0;
                transform: translateY(20px);
            }
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        .card:nth-child(2) { animation-delay: 0.2s; }
        .card:nth-child(3) { animation-delay: 0.4s; }
        .card:nth-child(4) { animation-delay: 0.6s; }
        .card:nth-child(5) { animation-delay: 0.8s; }

        @media (max-width: 768px) {
            #main {
                padding: 15px;
            }

            .brand-title {
                font-size: 2.5em;
            }

            .card {
                padding: 20px;
            }

            .button-group {
                grid-template-columns: repeat(2, 1fr);
                gap: 10px;
                padding: 15px;
            }

            .enter-button {
                padding: 12px 15px;
                font-size: 1em;
            }

            .link-list li {
                padding: 10px 15px;
            }
        }

        /* 添加背景动画 */
        @keyframes gradientBG {
            0% {
                background-position: 0% 50%;
            }
            50% {
                background-position: 100% 50%;
            }
            100% {
                background-position: 0% 50%;
            }
        }

        /* 弹窗样式 */
        .modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 1000;
            backdrop-filter: blur(5px);
        }

        .modal-content {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(255, 255, 255, 0.95);
            padding: 30px;
            border-radius: 20px;
            box-shadow: 0 10px 30px rgba(0,0,0,0.2);
            max-width: 90%;
            width: 400px;
        }

        .close-modal {
            position: absolute;
            right: 20px;
            top: 15px;
            font-size: 24px;
            cursor: pointer;
            color: #666;
            transition: all 0.3s ease;
        }

        .close-modal:hover {
            color: #b21f1f;
            transform: rotate(90deg);
        }

        /* 收藏方法卡片优化 */
        .save-method {
            padding: 15px;
            border-radius: 12px;
            background: rgba(255,255,255,0.5);
        }

        .save-card {
            background: rgba(255,255,255,0.8);
            padding: 20px;
            border-radius: 15px;
            text-align: center;
            transition: all 0.3s ease;
            border: 1px solid rgba(0,0,0,0.1);
        }

        .save-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 5px 15px rgba(0,0,0,0.1);
        }

        .save-icon {
            font-size: 24px;
            margin-bottom: 10px;
        }

        @media (max-width: 768px) {
            .save-method {
                grid-template-columns: 1fr;
            }
        }

        /* 新的弹窗样式 */
        .notice-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.7);
            z-index: 1000;
            backdrop-filter: blur(10px);
            animation: modalFadeIn 0.4s ease;
        }

        .notice-content {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: rgba(255, 255, 255, 0.97);
            padding: 40px;
            border-radius: 24px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.3);
            max-width: 90%;
            width: 420px;
            text-align: center;
            animation: modalPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        }

        .notice-title {
            font-size: 2em;
            color: #009efd;
            margin-bottom: 25px;
            font-weight: 600;
            background: linear-gradient(45deg, #2af598, #009efd);
            -webkit-background-clip: text;
            -webkit-text-fill-color: transparent;
        }

        .notice-text {
            line-height: 2;
            color: #34495e;
            font-size: 1.15em;
            margin-bottom: 30px;
        }

        .notice-text p {
            margin: 10px 0;
            opacity: 0;
            transform: translateY(10px);
            animation: textFadeIn 0.4s ease forwards;
        }

        .notice-text p:nth-child(1) { animation-delay: 0.1s; }
        .notice-text p:nth-child(2) { animation-delay: 0.2s; }
        .notice-text p:nth-child(3) { animation-delay: 0.3s; }
        .notice-text p:nth-child(4) { animation-delay: 0.4s; }

        .notice-btn {
            background: linear-gradient(45deg, #2af598, #009efd);
            color: white;
            border: none;
            padding: 15px 45px;
            border-radius: 30px;
            font-size: 1.1em;
            cursor: pointer;
            transition: all 0.3s ease;
            box-shadow: 0 5px 20px rgba(116, 235, 213, 0.3);
            transform: translateY(10px);
            animation: buttonPop 0.4s 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
            opacity: 0;
        }

        .notice-btn:hover {
            transform: translateY(-2px);
            box-shadow: 0 8px 25px rgba(159, 172, 230, 0.4);
            background: linear-gradient(45deg, #009efd, #2af598);
        }

        @keyframes modalPop {
            0% {
                transform: translate(-50%, -50%) scale(0.9);
                opacity: 0;
            }
            100% {
                transform: translate(-50%, -50%) scale(1);
                opacity: 1;
            }
        }

        @keyframes textFadeIn {
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        @keyframes buttonPop {
            to {
                opacity: 1;
                transform: translateY(0);
            }
        }

        /* 根据设备类型设置背景图 */
        /*
        @media (min-width: 769px) {
            body {
                background: url('images/desktop-bg.png') no-repeat center center fixed, linear-gradient(to right, #74ebd5 0%, #9face6 100%);
                background-size: cover, 200% 200%;
            }
        }

        @media (max-width: 768px) {
            body {
                background: url('images/mobile-bg.png') no-repeat center center fixed, linear-gradient(to right, #74ebd5 0%, #9face6 100%);
                background-size: cover, 200% 200%;
            }
        }
        */

        /* 添加背景图片加载失败的处理 */
        @media (min-width: 769px) {
            body.no-bg-image {
                background: linear-gradient(180deg, #2af598 0%, #009efd 100%);
                background-size: 200% 200%;
            }
        }

        @media (max-width: 768px) {
            body.no-bg-image {
                background: linear-gradient(180deg, #2af598 0%, #009efd 100%);
                background-size: 200% 200%;
            }
        }

        @media (max-width: 768px) {
            .save-tips {
                flex-direction: column;
            }
        }

        /* 音乐提示弹窗样式 */
        .music-prompt {
            position: fixed;
            top: 20px;
            right: -300px;
            background: rgba(255, 255, 255, 0.95);
            padding: 15px 20px;
            border-radius: 12px;
            box-shadow: 0 5px 20px rgba(0,0,0,0.15);
            display: flex;
            align-items: center;
            gap: 15px;
            transition: all 0.3s ease;
            z-index: 1000;
            backdrop-filter: blur(10px);
            border: 1px solid rgba(255,255,255,0.2);
        }

        .music-prompt.show {
            right: 20px;
            animation: slideIn 0.3s ease;
        }

        .music-prompt-text {
            color: #333;
            font-size: 0.95em;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .music-controls {
            display: flex;
            gap: 10px;
        }

        .music-btn {
            width: 32px;
            height: 32px;
            border-radius: 50%;
            border: none;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            transition: all 0.2s ease;
        }

        .music-btn.accept {
            background: linear-gradient(45deg, #2af598, #009efd);
            color: white;
        }

        .music-btn.decline {
            background: #ff4757;
            color: white;
        }

        .music-btn:hover {
            transform: scale(1.1);
        }

        @keyframes slideIn {
            from {
                right: -300px;
                opacity: 0;
            }
            to {
                right: 20px;
                opacity: 1;
            }
        }

        .countdown {
            font-size: 0.8em;
            color: #666;
            opacity: 0.8;
        }
    </style>
    </head>
<body>
<iframe id="background-iframe" src="assets/beij.html" frameborder="0" style="position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; overflow: hidden;"></iframe>
<audio id="bgMusic" loop preload="auto">
        <source src="" type="audio/mp3">
    </audio>
        <script charset="UTF-8" id="LA_COLLECT" src="//sdk.51.la/js-sdk-pro.min.js"></script>
<script>LA.init({id:"Kp5HbaWtPZ85k3dI",ck:"Kp5HbaWtPZ85k3dI",autoTrack:true})</script>
 <!-- 顶部跑马灯特效 --> 
  <style>
    #top-grrk{
    background:url();
    height:3px;//跑马灯高度
    position:fixed;
    width:100%;
    Z-index:10000;
}
    #nr{
    	font-size:20px;
    	margin: 0;
        background: -webkit-linear-gradient(left,
            #ffffff,
            #ff0000 6.25%,
            #ff7d00 12.5%,
            #ffff00 18.75%,
            #00ff00 25%,
            #00ffff 31.25%,
            #0000ff 37.5%,
            #ff00ff 43.75%,
            #ffff00 50%,
            #ff0000 56.25%,
            #ff7d00 62.5%,
            #ffff00 68.75%,
            #00ff00 75%,
            #00ffff 81.25%,
            #0000ff 87.5%,
            #ff00ff 93.75%,
            #ffff00 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
        background-size: 200% 100%;
        animation: masked-animation 2s infinite linear;
    }
    @keyframes masked-animation {
        0% {
            background-position: 0 0;
        }
        100% {
            background-position: -100%, 0;
        }
    }
    
    
    @font-face {
  font-family: "MyCustomFont";
  src: url("https://b6w.cn/GWZY/丸子API字体2.ttf") format("truetype");
}

body {
  font-family: "MyCustomFont", sans-serif;
}
</style> 
  <div id="top-grrk"></div> <!-- 顶部跑马灯特效 -->
 <body>
  <input type="hidden" id="_w_simile" data-inspect-config="3"> 
  <meta name="apple-mobile-web-app-title" content=""> 
  <title><?php echo htmlspecialchars($settings['title']); ?></title> 
  <style>
    
    <!--自定义CSS>
    #greetingBox {
        position: fixed;
        bottom: 10px;
        right: 15px;
        width: 400px;
        text-align: right;
        z-index: 10000;
        pointer-events: none
    }

    #greeting {
        display: inline-block;
        position: relative;
        opacity: 0;
        bottom: -110px;
        padding: 5px 40px;
        border-radius: 50px;
        background-color: #fff;
        color: #000;
        font-size: small;
        transition: .5s;
        box-shadow: rgb(0 0 0 / 5%) 0 10px 20px
    }

    #greeting.shown {
        opacity: 1;
        bottom: 0
    }
        	

<!--自定义CSS>-->
</style>   
  <div class="header"> 
   <div class="header-main"> 
    <div class="image"> 
     <img src=""> 
     <img src=""alt="" class="logo">
    </div> 
    <div class="name"> 
<center>
  <b id="nr"></b>
</center>







   

</small>
            <meta charset="utf-8">
<div class="deng-box2">
    <div class="deng">
        <div class="xian">
        </div>
        <div class="deng-a">
            <div class="deng-b">
                <div class="deng-t">你</div>
            </div>
        </div>
        <div class="shui shui-a">
            <div class="shui-c">
            </div>
            <div class="shui-b"></div>
        </div>
    </div>
</div>
<div class="deng-box3">
    <div class="deng">
        <div class="xian">
        </div>
        <div class="deng-a">
            <div class="deng-b">
                <div class="deng-t">操</div>
            </div>
        </div>
        <div class="shui shui-a">
            <div class="shui-c"></div>
            <div class="shui-b">
            </div>
        </div>
    </div>
</div>
<div class="deng-box1">
    <div class="deng">
        <div class="xian">
        </div>
        <div class="deng-a">
            <div class="deng-b">
                <div class="deng-t">妈</div>
            </div>
        </div>
        <div class="shui shui-a">
            <div class="shui-c"></div>
            <div class="shui-b"></div>
        </div>
    </div>
</div>
<div class="deng-box">
    <div class="deng">
        <div class="xian">
        </div>
        <div class="deng-a">
            <div class="deng-b">
                <div class="deng-t">死</div>
            </div>
        </div>
        <div class="shui shui-a">
            <div class="shui-c">
            </div>
            <div class="shui-b"></div>
                    
        </div>
    </div>
</div>
<style type="text/css">
    .deng-box {
        position: fixed;
        top: -40px;
        right: 150px;
        z-index: 9999;
        pointer-events: none;
    }
    .deng-box1 {
        position: fixed;
        top: -30px;
        right: 10px;
        z-index: 9999;
        pointer-events: none
    }
    .deng-box2 {
        position: fixed;
        top: -40px;
        left: 150px;
        z-index: 9999;
        pointer-events: none
    }
    .deng-box3 {
        position: fixed;
        top: -30px;
        left: 10px;
        z-index: 9999;
        pointer-events: none
    }
    .deng-box1 .deng,
    .deng-box3 .deng {
        position: relative;
        width: 120px;
        height: 90px;
        margin: 50px;
        background: #d8000f;
        background: rgba(216, 0, 15, .8);
        border-radius: 50% 50%;
        -webkit-transform-origin: 50% -100px;
        -webkit-animation: swing 5s infinite ease-in-out;
        box-shadow: -5px 5px 30px 4px #fc903d
    }
    .deng {
        position: relative;
        width: 120px;
        height: 90px;
        margin: 50px;
        background: #d8000f;
        background: rgba(216, 0, 15, .8);
        border-radius: 50% 50%;
        -webkit-transform-origin: 50% -100px;
        -webkit-animation: swing 3s infinite ease-in-out;
        box-shadow: -5px 5px 50px 4px #fa6c00
    }
    .deng-a {
        width: 100px;
        height: 90px;
        background: #d8000f;
        background: rgba(216, 0, 15, .1);
        margin: 12px 8px 8px 8px;
        border-radius: 50% 50%;
        border: 2px solid #dc8f03
    }
    .deng-b {
        width: 45px;
        height: 90px;
        background: #d8000f;
        background: rgba(216, 0, 15, .1);
        margin: -4px 8px 8px 26px;
        border-radius: 50% 50%;
        border: 2px solid #dc8f03
    }
    .xian {
        position: absolute;
        top: -20px;
        left: 60px;
        width: 2px;
        height: 20px;
        background: #dc8f03
    }
    .shui-a {
        position: relative;
        width: 5px;
        height: 20px;
        margin: -5px 0 0 59px;
        -webkit-animation: swing 4s infinite ease-in-out;
        -webkit-transform-origin: 50% -45px;
        background: orange;
        border-radius: 0 0 5px 5px
    }
    .shui-b {
        position: absolute;
        top: 14px;
        left: -2px;
        width: 10px;
        height: 10px;
        background: #dc8f03;
        border-radius: 50%
    }
    .shui-c {
        position: absolute;
        top: 18px;
        left: -2px;
        width: 10px;
        height: 35px;
        background: orange;
        border-radius: 0 0 0 5px
    }
    .deng:before {
        position: absolute;
        top: -7px;
        left: 29px;
        height: 12px;
        width: 60px;
        content: " ";
        display: block;
        z-index: 999;
        border-radius: 5px 5px 0 0;
        border: solid 1px #dc8f03;
        background: orange;
        background: linear-gradient(to right, #dc8f03, orange, #dc8f03, orange, #dc8f03)
    }
    .deng:after {
        position: absolute;
        bottom: -7px;
        left: 10px;
        height: 12px;
        width: 60px;
        content: " ";
        display: block;
        margin-left: 20px;
        border-radius: 0 0 5px 5px;
        border: solid 1px #dc8f03;
        background: orange;
        background: linear-gradient(to right, #dc8f03, orange, #dc8f03, orange, #dc8f03)
    }
    .deng-t {
        font-family: 黑体, Arial, Lucida Grande, Tahoma, sans-serif;
        font-size: 3.2rem;
        color: #dc8f03;
        font-weight: 700;
        line-height: 85px;
        text-align: center
    }
    .night .deng-box,
    .night .deng-box1,
    .night .deng-t {
        background: 0 0 !important
    }
    @-moz-keyframes swing {
        0% {
            -moz-transform: rotate(-10deg)
        }
        50% {
            -moz-transform: rotate(10deg)
        }
        100% {
            -moz-transform: rotate(-10deg)
        }
    }
    @-webkit-keyframes swing {
        0% {
            -webkit-transform: rotate(-10deg)
        }
        50% {
            -webkit-transform: rotate(10deg)
        }
        100% {
            -webkit-transform: rotate(-10deg)
        }
    }
</style>
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>卡密验证</title>
    <style>
        body {
    font-family: 'Arial', sans-serif;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start; /* Align content to the top to allow scrolling */
    min-height: 100vh; /* Ensure the body covers the entire viewport */
    margin: 0;
    background-color: #f7f7f7;
    text-align: center; /* Ensure text inside the body is centered */
    overflow-y: auto; /* Allow vertical scrolling */
    padding-top: 100px; /* Add some space at the top */
    width: 100%;
    height: auto; /* Ensure the height of the body adjusts based on content */
}

.container {
    display: flex;
    flex-direction: column;
    align-items: center;  /* Center everything inside the container */
    justify-content: flex-start; /* Align content to the top */
    width: 100%;
    flex-grow: 1; /* Allow the container to fill the remaining height */
}



input[type="text"], input[type="number"], #generatedUrl {
    width: 325px; /* Make the input fields wider */
    padding: 15px;
    font-size: 16px;
    margin-bottom: 10px;
    border: 2px solid #ddd;
    border-radius: 5px;
    box-sizing: border-box;
}

button {
    padding: 10px 20px;
    font-size: 18px;
    color: white;
    background-color: #007bff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
    margin-top: 10px;  /* Add margin on top for spacing */
}

button:hover {
    background-color: #0056b3;
}

#instruction {
    font-size: 14px;
    color: #333;
    margin-top: 20px;
}

/* New card layout for tutorial */
.card {
    background-color: #ffffff;
    border: 1px solid #ddd;
    border-radius: 8px;
    width: 80%;  /* Adjust the width of the card */
    padding: 20px;
    box-sizing: border-box;
    margin-top: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
    height: auto; /* Ensure card height is based on content */
}

.card h3 {
    font-weight: bold;
    font-size: 20px;
    color: #333;
}

.card p {
    font-size: 14px;
    color: #555;
    margin-top: 10px;
}
    </style>
</head>
<body>

    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.4/css/all.min.css">


    
    
    </div>
    <div class="container">
    </div>
     <div id="main">
        <div class="brand">
    <div class="brand-title">授权登录</div>

 </script>
<br>

        </div>
<?php if ($error): ?>
         <font style=color:#FF0000> <div class="error-msg"><?= $error ?></div></font>
            <?php endif; ?>
            <br>
 <form action="" method="POST" class="mk-side-form">
        <input type="text" name="kami"  placeholder="请输入授权卡密" required><br><br>
       
       <button type="submit" button class="notice-btn" >立即验证</button><br>
       <button type="button" button class="notice-btn" onclick="window.location.href='<?php echo htmlspecialchars($settings['km_url']); ?>'">获取卡密</button>
    
    </form>
<body>
    



</body>

</html>
<?php
exit();
}